package kr.co.icebird.swt.app;

import kr.co.icebird.swt.app.ch3.Ch3_Composite;
import kr.co.icebird.swt.app.ch4.Ch4_Composite;
import kr.co.icebird.swt.app.ch5.Ch5_Capitalizer;
import kr.co.icebird.swt.app.ch5.Ch5_Undoable;

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;

public class MainTestWindow extends ApplicationWindow {

	public MainTestWindow() {
		super(null);
	}
	
	protected Control  createContents(Composite parent) {
		
		TabFolder tf = new TabFolder(parent, SWT.NONE);
		
		TabItem chap3 = new TabItem(tf, SWT.NONE);
		chap3.setText("Chapter 3");
		chap3.setControl(new Ch3_Composite(tf));
		
		TabItem chap4 = new TabItem(tf, SWT.NONE);
		chap4.setText("Chapter 4");
		chap4.setControl(new Ch4_Composite(tf));
		
		TabItem chap5_01 = new TabItem(tf, SWT.NONE);
		chap5_01.setText("Chapter 5_01");
		chap5_01.setControl(new Ch5_Capitalizer(tf));
		
		TabItem chap5_02 = new TabItem(tf, SWT.NONE);
		chap5_02.setText("Chapter 5_02");
		chap5_02.setControl(new Ch5_Undoable(tf));
		
		getShell().setText("Widget Window");
		return parent;
	}
	
	public static void main(String[] args){
		MainTestWindow mwin = new MainTestWindow();
		mwin.setBlockOnOpen(true);
		mwin.open();
		Display.getCurrent().dispose();
	}
}
